package com.wrx.server.controller;


import com.wrx.server.pojo.RespBean;
import com.wrx.server.pojo.User;
import com.wrx.server.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.support.SessionStatus;

import javax.servlet.http.HttpSession;
import java.security.Principal;
//import 你自己的父类控制器;,没有就不用设置!;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wrx
 * @since 2021-03-26
 */
@RestController
//@RequestMapping("/server/user")
@Api(tags = "UserController")
public class UserController{

    @Autowired
    private IUserService userService;

    @ApiOperation(value = "判断用户是否登录且获取登录状态")
    @GetMapping("/user/info")
    public User getUserInfo(Principal principal) {
        return userService.getUserInfo(principal);
    }


}
